package demo2;

interface IShap {
    /*
    *默认是这样的
    public static final int a = 10;
    public abstract void draw();*/
    int a = 10;

    void draw();

    /*default void test() {
        System.out.println("test()") ;
    }

    static void test2() {
        System.out.println("static");
    }*/
}

class Rect implements IShap {
    @Override
    public void draw() {
        System.out.println("矩形");
    }
}

class Flower implements IShap {
    @Override
    public void draw() {
        System.out.println("❀");
    }
}

public class TestDemo {
    public static void drawMap(IShap iShap) {
        iShap.draw();
    }

    public static void main(String[] args) {
        IShap iShap1 = new Rect();
        IShap iShap2 = new Flower();
        drawMap(iShap1);
        drawMap(iShap2);

        drawMap(new Rect());
        drawMap(new Flower());
    }
}
